package com.zx.sdk.view.widget;

import android.content.Context;
import android.widget.FrameLayout;

import com.zx.sdk.model.AdInfo;

public abstract class BaseNewsAdView extends FrameLayout {

    protected INewsAdViewListener listener;
    protected AdInfo mAdInfo;

    public BaseNewsAdView(Context context, AdInfo adInfo) {
        super(context);
        this.mAdInfo = adInfo;
    }

    public void setListener(INewsAdViewListener listener) {
        this.listener = listener;
    }

    public abstract void backToHome(boolean clearHistory);

    public abstract boolean onBackPressed();

    public void onResume() {

    }

    public void onPause() {

    }

    public void onDestroy() {

    }

    public AdInfo getAdInfo() {
        return mAdInfo;
    }

    public interface INewsAdViewListener {

        void onNewsPageStart(String newsId);

        void onBackToHome();
    }
}
